<template>
  <div class="order-item" v-if="orderlist.orderInfo.rst.image_path" >
   <!--   -->
    <div class="item">
      <div class="img-wrap">
        <img :src="orderlist.orderInfo.rst.image_path" alt />
      </div>
      <div class="info">
        <div class="top">
          <div>
            <h4 class="title" v-if="orderlist.orderInfo.rst.name">{{orderlist.orderInfo.rst.name}}</h4>
            <span class="time">2019-4</span>
          </div>
          <div>订单完成</div>
        </div>
        <div class="bottom">
          <span>{{orderlist.orderInfo.selectFoods[0].name}}</span>
          <span class="price">￥{{orderlist.totalPrice}}</span>
        </div>
        <div class="btn-wrap">
          <span class="btn">再来一单</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    orderlist: {
      type: Object,
      default() {
        return {};
      }
    }
  },
};
</script>

<style scoped>
.order-item {
  background-color: #fff;
 
}
.item {
  padding: 10px;
  display: flex;
  border-bottom: 5px solid #ccc;
}
.img-wrap {
  width: 40px;
  height: 40px;
  margin-right: 10px;
}
img {
  width: 100%;
  height: 100%;
}
.info {
  flex: 1;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ccc;
}
.title {
  width: 200px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.time {
  line-height: 30px;
}
.bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 13px;
  color: #666;
}
.price {
  color: #000;
}
.btn-wrap {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  font-size: 12px;
  padding: 10px 0;
}
.btn {
  color: red;
  float: right;
  border: 1px solid red;
  padding: 5px;
  margin-right: 20px;
}
</style>